date_timestamp_set
Alias for DateTime::setTimestamp - Set DateTime object in Unix timestamp
date_timestamp_set()
function sets the date and time based on the Unix timestamp.
Set the date and time based on Unix timestamps:
<?php $date = date_create ( ) ; date_timestamp_set ( $date , 1472988263 ) ; echo date_format ( $date , "U = Ymd H:i:s" ) ; ?>
Try it yourself
date_timestamp_set ( object , unixtimestamp ) ;
parameter | describe |
---|---|
object | Required. Specifies the DateTime object returned by date_create() . This function modifies the object. |
unixtimestamp | Required. A Unix timestamp that specifies a date. |